import org.example.controller.*;
import org.example.model.ArticleInfo;
import org.example.service.ArticleService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {

        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");

//        APPConfig appConfig = context.getBean("student",APPConfig.class);
//        appConfig.say();
//        UserInfo userInfo = context.getBean("user", UserInfo.class);


//        userInfo.say();
//
//        // student没加注解,所以不会被存储到框架中,所以会报错
//        // 如果类注解的value没有设置,默认可以使用类名首字母小写的方式  获取bean对象
//        STudent sTudent = context.getBean("student",STudent.class);
//        sTudent.say();
////
//        // 可以使用xml bean注解的形式将student注入,xml+注解和xml这两种方式可以混合使用
//
//        Teacher teacher = context.getBean("teacher",Teacher.class);
//        teacher.say();
//
//        Car car = context.getBean("car", Car.class);
//        car.say();

//        UConfig uConfig = context.getBean("UConfig",UConfig.class);
//        uConfig.say();


        ArticleInfo articleInfo = context.getBean("a", ArticleInfo.class);
        System.out.println(articleInfo.toString());





    }
}
